package com.nekonomics
package api.dto.response

import com.nekonomics.domain.entity.Merchant

import java.time.OffsetDateTime
import zio.json.*

case class MerchantInfoDto(
  id: Long,
  userId: Long,
  name: String,
  logo: Option[String],
  desc: Option[String],
  createdAt: OffsetDateTime
) derives JsonEncoder


object MerchantInfoDto {
  def of(merchant: Merchant): MerchantInfoDto = 
    MerchantInfoDto(
      id = merchant.id,
      userId = merchant.userId,
      name = merchant.name,
      logo = merchant.logo,
      desc = merchant.description,
      createdAt = merchant.createdAt
    )  
}
